﻿<?php include $this->admin_tpl('meta');?>
<title>店铺列表</title>
</head>
<body>
<div class="page-container" style="padding-bottom:0;">
	<table id="table" lay-filter="table"></table>
</div>

<script type="text/html" id="op_temp">
	<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete" style="text-decoration:none;">删除</a>
</script>
<script type="text/html" id="tool_temp">

</script>
<?php include $this->admin_tpl('footer');?>
<script type="text/javascript" src="<?php echo STATIC_URL;?>plugin/layui/layui.js"></script>

<script>
var db = 'jst_shop';
layui.use(function(){ //亦可加载特定模块：layui.use(['layer', 'laydate', function(){
	table = layui.table; //表格
	util = layui.util; //工具集
	dropdown = layui.dropdown; //下拉菜单
	form = layui.form;
	//执行一个 table 实例
	option = {
		elem: '#table',
		id:'table',
		height: 'full-80',
		limit:30,
		limits:[30,60,90],
		url:'<?php echo U('wms');?>',
		where: $('#search').serializeJson(),
		title: '店铺列表',
		autoSort: false,
		page: {theme:'#409eff',groups:3,hash:true}, //开启分页
		toolbar: '#tool_temp', //开启工具栏，此处显示默认图标，可以自定义模板，详见文档
		cols: [[ //表头
			{type: 'checkbox', fixed: 'left'},
			{field: 'id', title: 'ID', width:80,align:'center'},
			{field: 'name', title: '分仓名称', align:'left'},
			{field: 'co_id', title: '主仓公司编号', width:200,align:'center'},
			{field: 'wms_co_id', title: '分仓编号',align:'center'},
			{field: 'is_main', title: '是否主仓',width:100,align:'center',templet:function(row){
				if(row.is_main == 1){
					return '<span class="yzm-status-enable"><i class="yzm-iconfont">&#xe81f;</i>主仓</span>';
				}else{
					return '<span class="red yzm-status-disable" style="color:#f56c6c;"><i class="yzm-iconfont">&#xe601;</i>分仓</span>';
				}
			}},

			{field: 'is_enable', title: '是否启用',align:'center',templet:function(row){
				if(row.is_enable == 1){
					return '<span class="yzm-status-enable" data-field="is_enable" data-text="启用|禁用" data-db="jst_wms" data-id="'+row.id+'" onclick="yzm_change_status(this,\'public_change_status\')"><i class="yzm-iconfont">&#xe81f;</i>启用</span>';
				}else{
					return '<span class="yzm-status-disable" data-field="is_enable" data-text="启用|禁用" data-db="jst_wms" data-id="'+row.id+'" onclick="yzm_change_status(this,\'public_change_status\')"><i class="yzm-iconfont">&#xe601;</i>禁用</span>';
				}
			}},
			{field: 'jst_name', title: '绑定聚水潭',align:'center',width:100},
			{field: 'remark1', title: '对方备注',align:'center',  width:200},
			{field: 'remark2', title: '我放备注',align:'center',  width:200},
			//{field: 'add_time', title: '添加时间',align:'center',width:150,templet: function(row) {return util.toDateString(row.add_time*1000, 'yyyy-MM-dd HH:mm:ss');}}
		]],
		done:function(res,curr,count){
			var options = this;
			public_table(db);
			select_table(options,<?php echo json_encode($this->jst_arr);?>,'.dropdown-jst',db,'jst_id');
		}
	};
	table.render(option);
	init_table(db);
})
	
</script>
</body>
</html>